#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
agent dto
"""

from typing import List, Dict, Any
from pydantic import BaseModel, Field, ConfigDict

from src.common.error import Code, Error

class AgentServiceParams(BaseModel):
    """ agent service parameters """
    user_id: str = Field(default='', description="user_id")  # 用户ID
    session_id: str = Field(default='', description="session_id") # 会话ID
    log_id: str = Field(default='', description="log_id") # log_id
    debug: bool = Field(default=False, description="debug") #debug
    stream: bool = Field(default=False, description="stream") #流式
    messages: List[Dict[str, Any]] = Field(default=[], description="messages") # 对话列表
    params: Dict[str, Any] = Field(default={}, description="params") # 其他业务上的额外参数, 自行定义

class AgentServiceResult(BaseModel):
    """ agent service parameters """
    code: Code = Field(default=Code.OK, description="code") # 错误码
    err_msg: str = Field(default='', description="err_msg")  # 错误信息
    user_id: str = Field(default='', description="user_id")  # 用户ID
    session_id: str = Field(default='', description="session_id") # 会话ID
    log_id: str = Field(default='', description="log_id") # log_id
    is_delta: bool = Field(default=False, description="is_delta") #是否为增量流式数据
    messages: List[Dict[str, Any]] = Field(default=[], description="messages") # 对话列表
    extra: Dict[str, Any] = Field(default={}, description="extra") # 其他业务上的额外参数, 自行定义
